<?php

abstract class ScheduleEvent
{
	
	protected $_id;
	protected $_event_id;
	protected $_dateE;
	
	public function __construct(array $donnees)
	{
		$this->hydrate($donnees);
	}
	
	public function hydrate(array $donnees)
	{
		foreach($donnees as $key => $value)
		{
			$method = 'set'. ucfirst($key);
			if(method_exists($this, $method))
			{
				$this->$method($value);
			}
		}
	}
	
	public function id() { return $this->_id; }
	public function event_id() { return $this->_event_id; }
	public function dateE() { return $this->_dateE; }
	
	public function setId($id)
	{
		$id = (int) $id;
		if(is_int($id))
		{
			$this->_id = $id;
		}
	}
	public function setEvent_id($event_id)
	{
		$event_id = (int) $event_id;
		if(is_int($event_id))
		{
			$this->_event_id = $event_id;
		}
	}
	public function setDateE($dateE)
	{
		$dateE = (String) $dateE;
		if(is_string($dateE))
		{
			$this->_dateE = $dateE;
		}
	}
}

?>